package com.weiwei.diancan.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.weiwei.diancan.R;
import com.weiwei.diancan.base.BaseActivity;
import com.weiwei.diancan.bean.LoginBean;

public class DanpinActivity extends BaseActivity {

    private TextView tv_name;
    private TextView tv_price;
    private LoginBean.MenuListBean.DishListBean menu;

    @Override
    public void getData() {
        tv_name.setText(menu.getDish_name());
        tv_price.setText("¥"+menu.getDish_price()+"/"+menu.getDish_unit());
    }

    @Override
    public void setListeners() {

    }

    @Override
    public void initView() {
        tv_name = (TextView)findViewById(R.id.tv_name);
        tv_price = (TextView)findViewById(R.id.tv_price);
    }

    @Override
    public void initTitle() {
        titler.setText(menu.getDish_name());
        iv_left.setVisibility(View.VISIBLE);
        iv_left.setText("返回");
        iv_left.setOnClickListener(v->finish());
    }

    @Override
    public void setLayoutView() {
        setContentView(R.layout.activity_danpin);
        menu = ( LoginBean.MenuListBean.DishListBean)getIntent().getExtras().getSerializable("menu");
    }
}
